import Vue from 'vue'
import VueRouter from 'vue-router'

//导入局部路由
import mainRouter from "@/views/main/router.js"

//导入登录路由
import LoginRouter from '@/views/login/route.js'

import AddressRouter from '@/views/address/route.js'


import DetailsRouter from '@/views/details/router.js'

import EditRouter from '@/views/edit/route.js'


Vue.use(VueRouter)

const routes = [
  {
    path:'',
    redirect:"/guide"
},
{
    path:"/guide",
    name:"guide",
    component:()=>import("@/views/guide/guide.vue")
},
  {
    path: '/app',
    name: 'app',
    component: () => import('@/views/main/main.vue'),
    children:[
      ...mainRouter
  ]
  },
  ...LoginRouter,
  ...DetailsRouter,
  ...AddressRouter,
  ...EditRouter
]

const router = new VueRouter({
  mode: 'hase',
  base: process.env.BASE_URL,
  routes
})

export default router
